<!doctype html>
<html lang="zh-CH">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title>木投网--商城</title>
	<link rel="stylesheet" href="/resource/css/mt_index.css">
	<link rel="stylesheet" href="/resource/css/mt_shopping.css">
</head>
<body>
@include('common.shop_head')
<!-- 分类搜索 -->
<div class="shop-classify main">
	<div class="title">当前位置：
		<a href="javascript:;">首页</a>&#62<a href="javascript:;">商城</a>
	</div>
	<div class="classify-info">
		<div class="classify-bor"></div>
			@foreach(Cache::get('cache_cate') as $k=>$v)
			<dl class="">
			<dt><a href="@if(empty($key_word))/shopping?category={{$v['id']}} @else /shopping?category={{$v['id']}}&key_word={{$key_word}} @endif">{{$v['name']}}</a></dt>
			<dd>
				@for($i=0;$i<count($v['classes']);$i++)
					<a href="shopping/?key_word={{$v['classes'][$i]['name']}}&category={{$v['id']}}">{{$v['classes'][$i]['name']}}</a>
				@endfor

				<span>展开<i class="down"></i></span>

			</dd>
			</dl>
			@endforeach
		<div class="classify-location">
			<div class="location-box"></div>
			<div class="location-box"></div>
			<div class="location-box"></div>
			<div class="location-box"></div>
			<div class="location-box"></div>
		</div>
	</div>
	<div class="classify-cont">
		<div class="classify-left left">
			<div class="til">
				<a href="@if(!empty($key_word)&&!empty($category))/shopping?key_word={{$key_word}}&sort_order=all&category={{$category}}
				@elseif(empty($key_word)&&!empty($category))/shopping?sort_order=all&category={{$category}}
				@elseif(!empty($key_word)&&empty($category))/shopping?key_word={{$key_word}}&sort_order=all
				@else/shopping?sort_order=all @endif " class="active">综合</a>
				<a href="@if(!empty($key_word)&&!empty($category))/shopping?key_word={{$key_word}}&sort_order=sales&category={{$category}}
				@elseif(empty($key_word)&&!empty($category))/shopping?sort_order=sales&category={{$category}}
				@elseif(!empty($key_word)&&empty($category))/shopping?key_word={{$key_word}}&sort_order=sales
				@else/shopping?sort_order=sales @endif">销量</a>
				<a href="@if(!empty($key_word)&&!empty($category))/shopping?key_word={{$key_word}}&sort_order=price_asc&category={{$category}}
				@elseif(empty($key_word)&&!empty($category))/shopping?sort_order=price_asc&category={{$category}}
				@elseif(!empty($key_word)&&empty($category))/shopping?key_word={{$key_word}}&sort_order=price_asc
				@else/shopping?sort_order=price_asc @endif" rel="price" dis="show">价格<i rel="top"></i></a>
				<a href="@if(!empty($key_word)&&!empty($category))/shopping?key_word={{$key_word}}&sort_order=price_desc&category={{$category}}
				@elseif(empty($key_word)&&!empty($category))/shopping?sort_order=price_desc&category={{$category}}
				@elseif(!empty($key_word)&&empty($category))/shopping?key_word={{$key_word}}&sort_order=price_desc
				@else/shopping?sort_order=price_desc @endif" rel="price" dis="hide">价格<i rel="bot"></i></a>
			</div>

			<div class="shopping-box">
				@foreach($data as $v)
				<div class="floor-shop">
					<div class="shop-img">
						<a href="shopping_details/?product_id={{$v->product_id}}&category={{$v->category}}"><img src="{{$v->product_img}}" alt=""></a>
					</div>
					<div class="shop-info">
						<a href="shopping_details/?product_id={{$v->product_id}}&category={{$v->category}}" class="name"><span>{{$v->product_name}}</span></a>
						<div class="price">￥{{$v->price}}/{{$v->unit}}</div>
					</div>
				</div>

				@endforeach



			</div>
				{{$data->appends(['key_word' => $key_word,'sort_order'=>$sort_order,'category'=> $category])->links()}}
			<ul class="pagination">

				<!--<li><a href="javascript:;">首页</a></li>
				<li><a href="javascript:;">&#60上一页</a></li>
				<li class="active"><a href="javascript:;">1</a></li>
				<li><a href="javascript:;">2</a></li>
				<li><a href="javascript:;">3</a></li>
				<li><a href="javascript:;">下一页 &#62</a></li>
				<li><a href="javascript:;">尾页</a></li>-->
			</ul>
		</div>
		<div class="classify-right left">

			<div class="classify-right">
				<div class="til">推广商品</div>
				<div class="emphases-box">
					<div class="floor-shop">
						<div class="shop-img">
							<a href="javascript:;"><img src="/resource/img/floor_shop_1.png" alt=""></a>
						</div>
						<div class="shop-info">
							<a href="javascript:;" class="name"><span>实木地板</span></a>
							<div class="price">￥500.00/立方米</div>
						</div>
					</div>
					<div class="floor-shop">
						<div class="shop-img">
							<a href="javascript:;"><img src="/resource/img/floor_shop_1.png" alt=""></a>
						</div>
						<div class="shop-info">
							<a href="javascript:;" class="name"><span>实木地板</span></a>
							<div class="price">￥500.00/立方米</div>
						</div>
					</div>
					<div class="floor-shop">
						<div class="shop-img">
							<a href="javascript:;"><img src="/resource/img/floor_shop_1.png" alt=""></a>
						</div>
						<div class="shop-info">
							<a href="javascript:;" class="name"><span>实木地板</span></a>
							<div class="price">￥500.00/立方米</div>
						</div>
					</div>
					<div class="floor-shop">
						<div class="shop-img">
							<a href="javascript:;"><img src="/resource/img/floor_shop_1.png" alt=""></a>
						</div>
						<div class="shop-info">
							<a href="javascript:;" class="name"><span>实木地板</span></a>
							<div class="price">￥500.00/立方米</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
@include('common.shop_foot')

<script src="/resource/js/jquery-1.11.3.min.js"></script>
<script src="/resource/js/mt_index.js"></script>
<script>
	//导航 商品全部 隐藏显示
	var $allW = $('.all-wrap');
	$allW.hide();
	$('.nav .nav-all').attr('rel','hide');
	$('.nav .nav-all').click(function(){
		if($(this).attr('rel') == 'hide'){
			$(this).attr('rel','show');
			$allW.show();
		}else{
			$(this).attr('rel','hide');
			$allW.hide();
		};		
	});
</script>
</body>
</html>